<!DOCTYPE html>
<html>

<head>
	<meta charset="UTF-8">
	<title>添加乘客</title>
	<link rel="stylesheet" href="/css/layui.css">
<link rel="stylesheet" href="/scriptZIP/layui.min.css">
	<link rel="stylesheet" href="/css/item.css">
	<style>
		.layui-row {
			margin-top: 50px;
		}

		.offer {
			width: 90px;
			height: 35px;
			background: #0086b6;
			color: white;
			text-align: center;
			line-height: 35px;
			font-size: 16px;
			border-radius: 4px;
		}

		.return {
			width: 80px;
			height: 35px;
			background: #0086b6;
			color: white;
			text-align: center;
			line-height: 35px;
			margin-top: -35px;
			margin-left: 130px;
			font-size: 16px;
			border-radius: 4px;
		}

		.vs--searchable .vs__dropdown-toggle {
			width: 70%;
			background-color: white;
			height: 36px;
		}

		ul[role="listbox"] {
			width: 70%;
			margin-left: 25px;
		}
	</style>
</head>

<body>
	

	<div class="layui-row" id="vue-root">
		<div class="layui-col-md6 layui-col-md-offset3">
			<div class="layui-form-item">
				<label class="layui-form-label">车牌号</label>
				<div class="layui-input-block">
					<input name="plate" autocomplete="off" placeholder="请输入校车车牌号" class="layui-input"
						v-model="item.plate">
					<div class="checkout_state"></div>
				</div>
			</div>

			<div class="layui-form-item">
				<label class="layui-form-label">车身颜色</label>
				<div class="layui-input-block">
					<input name="color" autocomplete="off" placeholder="请输入校车车身颜色" class="layui-input"
						v-model="item.color">
					<div class="checkout_state"></div>
				</div>
			</div>
			<div class="layui-form-item">
				<label class="layui-form-label">限载人数</label>
				<div class="layui-input-block">
					<input name="maxLoad" autocomplete="off" placeholder="请输入校车限载人数" class="layui-input"
						v-model="item.maxLoad">
					<div class="checkout_state"></div>
				</div>
			</div>

			<div class="layui-form-item">
				<label class="layui-form-label">生产公司</label>
				<div class="layui-input-block">
					<input name="producer" autocomplete="off" placeholder="请输入校车生产公司" class="layui-input"
						v-model="item.producer">
					<div class="checkout_state"></div>
				</div>
			</div>

			<div class="layui-form-item">
				<label class="layui-form-label">考勤机</label>
				<div class="layui-input-block">
					<select name="deviceId" data-vv-as="考勤机" class="input_select" v-model="item.deviceId"
						v-validate="'required'">
						<option disabled="disabled" :value="undefined">请选择考勤机</option>
						<option v-for="device in devices" :key="device.id" :value="device.id" v-text="device.name">
						</option>
					</select>
					<div class="checkout_state" v-text="err('deviceId')"></div>
				</div>
			</div>


			<div class="layui-form-item">
				<div class="layui-input-block">
					<div class="offer" @click="submit">立即提交</div>
					<div class="return" onclick="history.back()">取消</div>
				</div>
			</div>
		</div>
	</div>

	<script src="/scriptZIP/qs.min.js"></script>
	<script src="/scriptZIP/vue.min.js"></script>
	
	
	<script src="/scriptZIP/axios.min.js"></script>

	<script src="/js/common.js"></script>
	<script src="/js/item.js"></script>

	<script>

		var app = new Vue(merge({
			data: {
				item: {
					schoolId: top_params().id,
				},
				url: '/pc/bus',
				devices: [],
			},
			created: function () {
				var schoolId = this.item.schoolId;
				axios.get('/pc/device/all/' + schoolId).then(function (res) {
					this.devices = res.data;
				}.bind(this));
				this.init();
			}
		}));

	</script>

</body>

</html>